$.fn.extend({
    lazyload() {
        window.onscroll = function () {
            let totalShowHeight =
                (window.innerHeight || document.documentElement.clientHeight) +
                (document.body.scrollTop || document.documentElement.scrollTop)
            let imgsObj = document.querySelectorAll('img')
            this.forEach((item) => {
                let currentImgHeight = item.offsetTop
                if (totalShowHeight > currentImgHeight) {
                    item.src = item.getAttribute('data-original')
                }
            })
        }
    },
})
